<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "" "">
<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:w="http://www.apusic.com/jsf/widget" xmlns:layout="http://www.apusic.com/jsf/layout"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:ajax="http://www.apusic.com/jsf/ajax"
	renderKitId="AJAX">
	<w:head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<w:stylesheet src="/css/kmp4.css" type="text/css"></w:stylesheet>
		<w:script src="/javascript/k4.js" type="text/javascript" language="UTF-8"></w:script>
		<script>
		 	//<![CDATA[
		 	function showWindow(title,url){
			editRelation.location.href=url;
			editRelationWindowJsvar.setTitle(title);
			editRelationWindowJsvar.show();
		}
		function closeWindow(jsvar){
			editRelationWindowJsvar.hide();
			refreshData(jsvar);
		}
		  function refreshData(jsvar){
			//if(user_relation)
				//user_relation.location.reload();
			//if(prvilidge_relation)
				//prvilidge_relation.location.reload();
				
			if(jsvar!=null&&''!=jsvar){
				var frame=document.getElementById(jsvar+'_frame');
				var src=frame.src;
				frame.src=src;
			}
		}
		     //]]>
		 </script>
	</w:head>
	<w:page title="查看角色">
		<layout:borderLayout fitToBody="true">
			<layout:panel region="center" fit="true" autoScroll="true" split="true" border="false"
				styleClass="k4-combineform">
				<w:form>
					<w:toolBar>
						<w:button value="分配角色用户"
							image="#{facesContext.externalContext.requestContextPath}/images/edit.gif" immediate="true"
							alwaysSubmit="false"
							onclick="javascript:showWindow('分配角色用户','#{facesContext.externalContext.requestContextPath}/modules/system/editRoleUser.faces?roleId=#{system_showSecurityRoleBean.roleId}')" />
						<w:separator />
						<w:button value="分配角色权限"
							image="#{facesContext.externalContext.requestContextPath}/images/edit.gif" immediate="true"
							alwaysSubmit="false"
							onclick="javascript:showWindow('分配角色权限','#{facesContext.externalContext.requestContextPath}/modules/system/editResourceRole.faces?roleId=#{system_showSecurityRoleBean.roleId}')" />
					</w:toolBar>
					<layout:panelGrid columns="2" cellpadding="0" cellspacing="0" border="1"
						styleClass="k4-combineform-grid">
						<layout:cell styleClass="k4-form-fieldtitle">
							<h:outputLabel value="角色代码" />
						</layout:cell>
						<layout:cell styleClass="k4-form-fieldvalue">
							<h:outputText id="rolename"></h:outputText>
						</layout:cell>
						<layout:cell styleClass="k4-form-fieldtitle">
							<h:outputLabel value="角色名称" />
						</layout:cell>
						<layout:cell styleClass="k4-form-fieldvalue">
							<h:outputText id="displayName"></h:outputText>
						</layout:cell>
						<layout:cell styleClass="k4-form-fieldtitle">
							<h:outputLabel value="角色描述" />
						</layout:cell>
						<layout:cell styleClass="k4-form-fieldvalue">
							<h:outputText id="description"></h:outputText>
						</layout:cell>
					</layout:panelGrid>
				</w:form>
			</layout:panel>
			<layout:panel region="south" split="true" fit="true" height="200" border="false">
				<layout:tabLayout border="false">
					<layout:panel id="user_relation" jsvar="user_relation" title="关联人员" lazyload="true"
						border="false"
						url="#{facesContext.externalContext.requestContextPath}/modules/system/personsOfOneRole.faces?roleId=#{system_showSecurityRoleBean.roleId}">
					</layout:panel>
					<layout:panel id="prvilidge_relation" title="关联权限" lazyload="true" border="false"
						url="#{facesContext.externalContext.requestContextPath}/modules/system/resourcesOfOneRole.faces?roleId=#{system_showSecurityRoleBean.roleId}">
					</layout:panel>
				</layout:tabLayout>
			</layout:panel>
		</layout:borderLayout>
		<layout:window id="editRelationWindow" jsvar="editRelationWindowJsvar" title="编辑角色" show="false"
			autoScroll="true" width="450" height="420" y="50" x="150">
			<w:iframe id="editRelation" name="editRelation" style="width:100%;height:98%;" frameborder="0"></w:iframe>
		</layout:window>
	</w:page>
</f:view>